using UnityEngine;

public class ScreenOrientation : MonoBehaviour
{
	public bool autoRotate;

	private void Start()
	{
		if (autoRotate)
		{
			Screen.orientation = UnityEngine.ScreenOrientation.AutoRotation;
			Screen.autorotateToLandscapeLeft = true;
			Screen.autorotateToLandscapeRight = true;
			Screen.autorotateToPortrait = false;
			Screen.autorotateToPortraitUpsideDown = false;
		}
		else
		{
			Screen.autorotateToLandscapeLeft = false;
			Screen.autorotateToLandscapeRight = false;
			Screen.autorotateToPortrait = false;
			Screen.autorotateToPortraitUpsideDown = false;
		}
	}
}
